"""
    Room.py - This handles misc. room functions
    Copyright (C) 2009  Matthew Baldwin <secretagentcook@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>
"""

import Player
import DatabaseAbstractionLayer.dbAccess

class Room(object):
    """ Functions for handling rooms """

    def ___init___(self):
        #dbAccess.Access()
        #self.session = dbAccess.Access.Session()
        self.session = Player.Player.session

    
    def room_display(self, roomNumber):
        self.roomNumber = roomNumber
        self.roomName = Player.Player.session.query(Database.dbAccess.Access.Rooms).filter_by(number=self.roomNumber)
        self.roomDesc = Player.Player.session.query(Database.dbAccess.Access.Rooms.desc).filter_by(number=self.roomNumber)
        
        Player.Player.write_plain(self.roomName)
        Player.Player.write_plain('\n')
        Player.Player.write_plain(self.roomDesc)

    def start_room(self, roomNumber):
        self.roomNumber = roomNumber
        self.room_display(self.roomNumber)

Room = Room()
